package com.one.react.internal;

import com.sun.tools.javac.file.JavacFileManager;
import com.sun.tools.javac.parser.JavacParser;
import com.sun.tools.javac.parser.ParserFactory;
import com.sun.tools.javac.util.Context;

public class MyParser {
    private static MyParser INSTANCE;

    private Context context;

    private MyParser(Context context) {
        this.context = context;
    }

    public static MyParser getInstance(Context context) {
        if (INSTANCE == null) {
            INSTANCE = new MyParser(context);
        }
        return INSTANCE;
    }

    public JavacParser getParserFor(CharSequence input) {
        return ParserFactory.instance(context)
                .newParser(input, false, false, false);
    }
}
